 {% extends "index.html" %}
 
 {% load fio %}
{% load datepicker_init datepicker %}

{% block title %}
	Статистика на {{ data.date }}
{% endblock %}

{% block content %}
	<h4>Всего за день: {{ data.day.total }}.</h4>
	{% for day in data.day.verbose %}
		<div>
		{{ day.user|fio }}: {{ day.total }}
		</div>
	{% endfor %}
	
	<h4>Всего за {{ data.month_name }}: {{ data.month.total }}.</h4>
	{% for month in data.month.verbose %}
		<div>
		{{ month.user|fio }}: {{ month.total }}
		</div>
	{% endfor %}
{% endblock %}

{% block sidebar %}
	{% datepicker_init %}
	<script>
		var dp_init = {
			date: '{{ data.date|date:"Y-m-d" }}',
			current: '{{ data.date|date:"Y-m-d" }}',
			format: 'Y/m/d',
			view: 'moths',
			onChange: function(date) {
					document.location='/okno/stats/'+date;
					return true;
			},
			
			show: true,
		};
	</script>
	{% datepicker datepicker dp_init %}
	<div id="datepicker"></div>
{% endblock %}